<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div>
        ddddd

    </div>
</body>
<script>
    console.log('444444')
    window.addEventListener("beforeunload", function(){
        console.log('11111')
        return '关闭本页面会导致您的直播异常中断。\n您确定要关闭本页面吗？';
    }, !1)
    console.log('222222')
</script>
</html>